package com.bamboo.framework.common.qiniu.kodo.web;

import com.bamboo.framework.common.format.ReturnMsg;
import com.bamboo.framework.common.qiniu.kodo.util.UploadFiles;
import java.io.IOException;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: GuoQing
 * @Date: 2019/1/30 11:56
 * @description 上传文件控制层
 */
@RestController
@RequestMapping("upload")
public class UploadController {

  @Resource

  private UploadFiles uploadFiles;

  /**
   * 图片上传接口
   */
  @PostMapping("image")
  public ReturnMsg uploadImage(MultipartFile file) throws IOException {
    return uploadFiles.uplodImage(file.getInputStream());

  }
}
